#ifndef CPP_TOOLS_SK_STORAGE_UTIL_HPP
#define CPP_TOOLS_SK_STORAGE_UTIL_HPP
#pragma once

#include <chrono>
#include <mutex>
#include <string>

namespace sk_storage {

class EasySnowflake {
private:
  std::mutex mu;
  uint16_t cnt_on_one_step_;
  uint64_t last_timestamp_;

public:
  EasySnowflake();
  uint64_t NewId();
  ~EasySnowflake() = default;
};
// only used in log
static EasySnowflake easySnowflake;

} // namespace sk_storage

#endif